<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<link href="./css/screen.css" rel="stylesheet" type="text/css" />
</h:head>
<f:event listener="#{systemNavigatePage.userSupportRole}"
	type="preRenderView"></f:event>
<body>
	<ui:include src="./header.xhtml" />
	<div id="content-outer">
		<div id="content">

			<!--  start page-heading -->
			<div id="page-heading">
				<h1>Change User State</h1>
			</div>
			<!-- end page-heading -->
			<h:messages infoStyle="color: blue;" errorStyle="color: orange;" />
			<table border="0" width="100%" cellpadding="0" cellspacing="0"
				id="content-table">
				<tr>
					<th rowspan="3" class="sized"><img
						src="images/shared/side_shadowleft.jpg" width="20" height="300"
						alt="" /></th>
					<th class="topleft"></th>
					<td id="tbl-border-top">&nbsp;</td>
					<th class="topright"></th>
					<th rowspan="3" class="sized"><img
						src="images/shared/side_shadowright.jpg" width="20" height="300"
						alt="" /></th>
				</tr>
				<tr>
				<td id="tbl-border-left"></td>
				<td>
				<!--  start top-search -->
								<div id="top-search" style="padding-bottom: 40px">
									<h:form>
										<table border="0" cellpadding="0" cellspacing="0">
											<tr>

												<td
													style="font-weight: bold; padding-right: 10px; font-size: 16px;">
													Select State</td>
												<td><h:selectOneMenu
														value="#{systemUserChangeState.selectedUserState}"
														class="styledselect" onchange="submit()"
														valueChangeListener="#{systemUserChangeState.changeSelectButton}">
														<f:selectItem itemValue="active" itemLabel="Active">
														</f:selectItem>
														<f:selectItem itemValue="disable" itemLabel="Disable">
														</f:selectItem>

													</h:selectOneMenu></td>
											</tr>
											<tr>
												<td></td>
												<td style="padding-top: 20px"><h:inputText
														value="#{systemUserChangeState.searchValue}"
														class="top-search-inp"
														style="width: 150px;  height:30px; padding: 0px" />
													&nbsp;</td>
												<td style="padding-top: 20px; width: 150px"><h:selectOneMenu
														style="width: 150px"
														value="#{systemUserChangeState.selectSearchType}"
														class="styledselect">
														<f:selectItem itemValue="idCardNumber"
															itemLabel="ID Card Number"></f:selectItem>
														<f:selectItem itemValue="systemUserID"
															itemLabel="System User ID"></f:selectItem>
														<f:selectItem itemValue="email" itemLabel="Email"></f:selectItem>
														<f:selectItem itemValue="firstName" itemLabel="First Name"></f:selectItem>

													</h:selectOneMenu></td>
												<td style="padding-top: 20px"><h:commandButton
														value="Search"
														style="height:30px; font-size:18px; padding-top:0px"
														action="#{systemUserChangeState.search}"
														class="top-search-inp" /></td>
											</tr>
										</table>

									</h:form>
								</div>
								<!--  end top-search -->
				</td>
				<td id="tbl-border-right"></td>
				</tr>
				<tr>
					<td id="tbl-border-left"></td>
					<td>
					
						<!--  start content-table-inner ...................................................................... START -->
						<div id="content-table-inner">

							<!--  start table-content  -->
							<div id="table-content">

								<!--  start message-green -->
								
								<!--  end message-green -->


								<!--  start product-table ..................................................................................... -->
								<h:form id="mainform">
									<p:dataTable width="100%" var="list" paginator="true" rows="10"
										widgetVar="accTable"
										paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
										rowsPerPageTemplate="5,10,15"
										value="#{systemUserChangeState.systemUserDataModel}"
										selection="#{systemUserChangeState.selectedSystemUsers}">

										<p:column selectionMode="multiple" style="width:2%" />
										<p:column sortBy="#{list.systemUserID}">
											<f:facet name="header">SystemUser ID</f:facet>
											<h:outputText value="&nbsp;#{list.systemUserID}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.userName}">
											<f:facet name="header">User Name</f:facet>
											<h:outputText value="&nbsp;#{list.userName}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.firstName}">
											<f:facet name="header">Full Name</f:facet>
											<h:outputText
												value="#{list.lastName} #{list.midName} #{list.firstName}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.createdDate}">
											<f:facet name="header">Created Date</f:facet>
											<h:outputText value="&nbsp;#{list.createdDate}">
											</h:outputText>
										</p:column>
										<p:column sortBy="#{list.systemUserState}">
											<f:facet name="header">State</f:facet>
											<h:outputText value="&nbsp;#{list.systemUserState}">
											</h:outputText>
										</p:column>



									</p:dataTable>

									<table border="0" cellpadding="0" cellspacing="0"
										style="float: left; margin-left: 810px">
										<ui:fragment
											rendered="#{systemUserChangeState.changeButtonValue == 'Active'}">
											<tr>
												<td></td>
												<td style="padding-left: 190px"><h:commandButton
														class="top-search-inp" value="Change To Disable"
														type="submit"
														style="height:30px; font-size:14px; padding-top:0px"
														action="#{systemUserChangeState.changeToDisable}"></h:commandButton>

												</td>

											</tr>
										</ui:fragment>
										<ui:fragment
											rendered="#{systemUserChangeState.changeButtonValue == 'Disable'}">
											<tr>
												<td></td>
												<td style="padding-left: 190px"><h:commandButton
														class="top-search-inp" value="Change To Active"
														type="submit"
														style="height:30px; font-size:14px; padding-top:0px"
														action="#{systemUserChangeState.changeToActive}"></h:commandButton>

												</td>

											</tr>
										</ui:fragment>
										<ui:fragment
											rendered="#{systemUserChangeState.changeButtonValue == ''}" />

									</table>

									<!--  end product-table................................... -->
								</h:form>

							</div>
							<!--  end content-table  -->

							<!--  start paging..................................................... -->

							<!--  end paging................ -->

							<div class="clear"></div>

						</div> <!--  end content-table-inner ............................................END  -->
					</td>
					<td id="tbl-border-right"></td>
				</tr>
				<tr>
					<th class="sized bottomleft"></th>
					<td id="tbl-border-bottom">&nbsp;</td>
					<th class="sized bottomright"></th>
				</tr>
			</table>
		</div>
	</div>
</body>
</html>

